﻿using System;
using System.Collections.Generic;
using System.Text;
using Domain.Commons;
using ORM.Annotations;

namespace Motorbike.Model
{
    [EntityTable("b_waybill_item")]
    public class WaybillItem : Identifer
    {
        [EntityFeild("id", Id = true)]
        public string Id { get; set; }

        [EntityFeild("bill_id", Id = true)]
        public string BillId { get; set; }

        [EntityFeild("item_id", Id = true)]
        public string ItemId { get; set; }

        [EntityFeild("billing_price", Id = true)]
        public decimal BillingPrice { get; set; }

        [EntityFeild("real_price", Id = true)]
        public decimal RealPrice { get; set; }

        [EntityFeild("amount", Id = true)]
        public int Amount { get; set; }

        public static WaybillItem create(string billId, string itemId)
        {
            WaybillItem item = new WaybillItem();
            item.BillId = billId;
            item.ItemId = itemId;
            return item;
        }
    }
}
